#ifndef __RSE_H__
#define __RSE_H__

#include <iostream>
#include "Forest.h"
#include "Distance.h"

// Forward Declaration
class Lse;

//left subforest enumeration

class Rse 
{
	Forest W;
	Tree* inTree;
	vector<Tree*>* Table;
	vector<int>* ForestSize;
	Distance* distance;
	int currSize;

public:
	Rse(Tree* G, Distance* distance1);
	~Rse();
	void Left_To_Right_Preorder_Traversal(Tree* G, bool restart);//sets the value of RTLP field of each node in G
	void Convert(vector<int>* T , Lse &lse);//converts the Table T from LSE to RSE
	void find_Rse(Tree* G);//computes the RSE of the tree G
	void DeleteLeftVertex(int i,Tree* G);//deletes i left vertxes and updates W with the recieved forest
	void DeleteRightVertex(int i,int j);//deletes j right vertexes after the i left vertexes habe been deleted from W and updates Table
	Tree* GetT(){return inTree;}
	int get_JofI(int i);

	Tree* GetForest(int i,int j);//returns Gij
	int GetForestSize(int i, int j);//returns the delete cost of Gij
	
};

#endif //__RSE_